package com.yanqu.road.server.cmd.activity.serverbuymall;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ServerMallBuyProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.snowgarden.CrossActivityMallDayBuyMgr;
import com.yanqu.road.server.manager.activity.snowgarden.CrossMallDayBuyActivity;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_SEVER_MALL_BUY_GET_DAY_BUY_DATA, desc = "请求跨服购买累计")
public class CrossMallBuyGetDayBuyCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        ServerMallBuyProto.ServerQueryMallTotalBuyReqMsg reqMsg = ServerMallBuyProto.ServerQueryMallTotalBuyReqMsg.parseFrom(packet.getBytes());
        CrossMallDayBuyActivity activity = CrossActivityMallDayBuyMgr.getActivity(reqMsg.getActivityId());
        if (activity != null) {
            activity.addNeedSyncServerId(serverId);
        }
    }

    @Override
    public void sendData() {
    }
}
